<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>活动邀请</title>

    <%include ../../common.ejs%>


</head>

<script type="text/javascript">
    function removeAdd(id, name) {
        var temp = "<option id=" + id + " value=" + id + ">" + name + "</option>";
        $('#show').append(temp);
        $("#wei" + id).remove();
        var temp = document.getElementById('selected')
        temp.value = $('#show').find('option').length;
    }

    function _submit() {
        var temp = $('#show').find('option');
        for (var i = 0; i < temp.length; i++) {
            var str = temp[i].id + '.' + str;
        }
        $('#hiddenInput').val(str);

    }
    function goback() {
        window.history.back()
    }
</script>

<body>
<div id="top">
    <% include ../top.ejs%>
</div>
<div class="container-fluid" style="margin-top: 20px;">
    <div class="row">
        <div class="col-md-1">
        </div>
        <div id="left" class="col-md-2">
            <% include ../left.ejs%>
        </div>
        <div class="col-md-8 bodyDiv" id="right">
                <form method="get" action="/admin/activityManage/invite">
                    <div class="row">
                        <div class="col-md-3" >
                     <span  class="headTitle">人员邀请</span>
                        </div>
                        <div class="col-md-2" style="padding-top: 30px;">
                        </div>
                        <div class="col-md-2" style="padding-top: 30px;">
                        </div>
                        <div class="col-md-2" style="padding-top: 30px;">
                        </div>
                    </div>
                    <div class="row">
                        <div class="col-md-12"
                             style="height:311px; width: 853px;margin-top: 30px;margin-left: 5px; width: 100%;">
                            <div class="container" style="height: 335px;width: 750px;background-color:ghostwhite">
                                <div class="col-md-12">
                                    <div class="col-md-2">
                                        <!--隐藏输入框-->
                                        <input type=text name="id" id="hiddenInput" style="display: none">
                                        <input type=text name="activeId" id="hiddenInput" value="<%=active%>" style="display: none">

                                    </div>
                                    <div class="col-md-2" style="padding-top: 29px;">
                                    </div>
                                    <div class="col-md-2" style="padding-top: 30px;">
                                    </div>
                                    <div class="col-md-2"></div>
                                    <div class="col-md-2" style="padding-top: 30px;">
                                        <input type="text" id="selected" class="form-control" placeholder="已选人数" style="height: 30px" disabled="disabled">
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="col-md-2"></div>
                                    <div class="col-md-4" style="padding-top: 29px;">
                                        <select multiple class="form-control" style="height: 200px;width: 150px">
                                            <% if(answer!=undefined){%>
                                                <% for(var i=0; i <answer.length ; i++) { %>
                                                    <option id="wei<%=answer[i].id%>" onclick="removeAdd('<%=answer[i].id%>','<%= answer[i].name %>')"><%=                                                        answer[i].name %>
                                                    </option>
                                                <% } %>
                                            <% } else{%>
                                            <% } %>

                                        </select>
                                    </div>
                                    <div class="col-md-1"></div>
                                    <div class="col-md-4" style="padding-top: 29px;">
                                        <select id="show" multiple class="form-control"
                                                style="height: 200px;width: 150px" name="">
                                        </select>
                                    </div>
                                </div>
                                <div class="col-md-12">
                                    <div class="col-md-2"></div>
                                    <div class="col-md-4" style="padding-top: 10px;">
                                        <button type="submit" onclick="_submit()" class="btn btn-success btn-sm " style="width:150px ">确定
                                        </button>
                                    </div>
                                    <div class="col-md-1"></div>
                                    <div class="col-md-4" style="padding-top: 10px;">
                                        <button type="button" class="btn btn-warning btn-sm " style="width:150px " onclick="goback()">取消 </button>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </div>
                    <!--内容-->
                </form>
            <div class="col-md-1">
            </div>
        </div>
    </div>
</div>

</body>

</html>